The Status ('stat') Resource
You need to include a status resource, of typestatusType
, to define the status messages that are displayed during the printing process. The driver forces status messages to be displayed by calling either theGXReportStatus
function (for simple messages) or theGXAlertTheUser
function (for messages that require user attention).Figure 6-2 shows the structure of the status resource.
Figure 6-2 The status resource
The status resource contains a count of the status entries and an array of status definitions.
Each status definition contains four values:
- Status owner. The signature of the printing extension or printer driver to which this status resource belongs.
Most of the status types produce side effects. For example, if you send a status message with status type
- Status type. The kind of status message that this is. The status type constants are shown in Table 6-3.
- Status ID. The ID of this status message within the status resource. You typically assign sequential numbers to the status messages within each status resource, as shown in the example at the end of this section.
- Status alert ID. The ID of the printing alert associated with this status message. Use the ID 0 to indicate that this status message does not require a printing alert.
- Status string. The status message string to display to the user.
gxSpoolingPageStatus
, the page count is incremented in the spooling status that is displayed on the user's screen. Table 6-3 shows the status type constants and the side effects associated with each.Listing 6-3 shows an example of a status resource.
Listing 6-3 An example of a status resource
#define kDrvrCreatorType 'IWII' resource statusType (kDriverStatus, sysHeap, purgeable) { kDrvrCreatorType, { gxInformationalStatus, 1, 0, "Sending data to printer"; gxUserAlert, 1, kDriverStatus, "Please check that the printer is on-line"; }; };Listing 6-3 defines a status resource for the ImageWriter II printer driver. This resource defines two status text strings. The first text string is an informational message that does not require a printing alert box and is displayed in the desktop printer window. The second text string requires user attention and is displayed in a printing alert box.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help